Occasionally-binding constraints by piecewise-linear approximations =================================================================== The principle ------------- The piecewise-linear (OccBin-style, after Guerrieri and Iacoviello) approach treats the model as having two linear regimes -- one in which the constraint is slack and the unconstrained equations hold, one in which it binds and the constrained equation is replaced by the binding condition. Given a *guess* of the dates at which the constraint is binding, each regime's linear solution is known, so the whole path can be computed; the guess is then revised (the constraint should bind exactly when the guessed-slack solution would violate it, and vice versa) and the process iterated until the guess is consistent with the path it implies. It is fast and easy to interpret, at the cost of being first-order and of *not* handling the stochastic anticipation of the constraint (agents do not price in the possibility of hitting it). Setting it up ------------- You declare the inequality as for the other routes (the ``@constraint`` option of the ``@optimization_problem`` block -- see :doc:`OCB`) and switch the model to the piecewise-linear solver via the ``solve_occbin`` option (which carries the binding-regime specification). ``solve`` then returns the regime-conditional linear solutions, and ``simulate`` / ``irf`` / ``forecast`` run the guess-and-iterate scheme on them. .. todo:: Document the ``solve_occbin`` option precisely (what it expects, how the binding regime is specified, the iteration controls) and add a worked example. Estimation ---------- Estimation with the piecewise-linear method is **not supported in RISE** -- estimate the constrained model with the :doc:`regime-switching ` or :doc:`anticipated-shocks ` route instead (both of which provide a likelihood), or use Dynare's ``occbin`` for the piecewise-linear treatment.